{template "","header"}
<script type="text/javascript" src="{JS_PATH}108wo/dropmenu.js"></script>
<script type="text/javascript">
<!--
	function sendPrice(obj, id)
	{
		var price = parseFloat($('#price_'+id).val(), 2);
		if(price) {
			$(obj).attr("disabled", true);
			$.getJSON('{APP_PATH}index.php?m=order&c=order_detail&a=update_price', {id:id, price:price, ajax:1}, function(data){
				$('#td1_'+id).html(price);
				$('#td2_'+id).html('<a href="javascript:void(0);" onclick="return changePrice(this, '+id+');">修改</a>');
			});
		} else alert('您填的价格不正确！');
	}

	function changePrice(obj, id) {
		$('#td1_'+id).html('<input type="text" name="price" id="price_'+id+'" value="'+$(obj).parent().prev().html()+'" size="5"/>');
		$('#td2_'+id).html('<button onclick="sendPrice(this, '+id+');">发送价格</button>');
	}
//-->
</script>
<div id="main">
	<div class="user">
		{template '', 'account_manage_left'}
		<div class="right">
			<div class="po">当前位置：会员中心 > <span>产品询价</span></div>
			<div class="price">
				<p>共有<span class="b green">{$total}</span>条询价记录，有{$untotal}还未处理。</p>
				<table cellpadding="0" cellspacing="1">
					<thead>
						<tr>
							<td width="15%">会员</td>
							<td >产品名称</td>
							<td width="10%" align="center">参考价</td>
							<td width="15%" align="center">发送价格</td>
							<td width="20%" align="center">咨询时间</td>
						</tr>
					</thead>
					<tbody>
						{loop $product_data $r}
						<tr>
							<td class="member">
								<a href="#" class="b" rel="dropmenu1">{$r[username]}</a>
								<div class="dropmenudiv" id="dropmenu1">
									<ul>称呼：<b>{$r[nickname]}</b></ul>
									<ul><a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin={$r[qq]}&Site=108wo.com&Menu=yes><img border=0 SRC=http://wpa.qq.com/pa?p=4:{$r[qq]}:4 alt=点击这里给我发消息>{$r[qq]}</a></ul>
								</div>
							</td>
							<td><a href="{APP_PATH}{$r[thumb]}" rel="photoGroup" title="{$r[producttitle]}">{$r[producttitle]}</a></td>
							{if $r[price]}
							<td align="center" id="td1_{$r[id]}">{$r[price]}</td>
							<td align="center" id="td2_{$r[id]}"><a href="javascript:void(0);" onclick="return changePrice(this, {$r[id]});">修改</a></td>
							{else}
							<td align="center" id="td1_{$r[id]}"><input type="text" name="price" id="price_{$r[id]}" value="{$r[price]}" size="5"/></td>								
							<td align="center" id="td2_{$r[id]}"><button onclick="sendPrice(this, {$r[id]});">发送价格</button></td>
							{/if}
							<td align="center">{date('Y-m-d', $r[enquirytime])}</td>
						</tr>
						{/loop}
					</tbody>
					<tfoot>
						<tr>
							<td colspan="4">
								<div class="pageList">
								
									{$product_pages}
								
								</div>	
							</td>
						</tr>
					</tfoot>
				</table>
			</div>
		</div>
		<div class="clearit"></div>
	</div>
</div>
{template "","footer"}
